<template>
	<view style="height: 100%;">
		<swiper :indicator-dots="false" :autoplay="false" :interval="3000" :duration="1000" :vertical="false"
			:circular="true" style="background-color: aquamarine;height: 150px;" :current="3" @change="swiperChange">
			<swiper-item v-for="item,index in list">
				<view class="swiper-item" style="width: 100%;height: 100%;">
					<image :src="item" mode="" style="width: 100%;height: 100%;"></image>
				</view>
			</swiper-item>
		</swiper>
		<view class="grid-item" style="width: 60px;height: 45px;">功能列表</view>
		<uni-grid :column="5" @change="gridChange">
			<uni-grid-item :index="index" v-for="(item,index) in typelist">
				<view class="grid-item">
					<image :src="'/static/'+item.icon" mode="" style="width: 60px;height: 45px;"></image>
					<text>{{item.typename}}</text>
				</view>
			</uni-grid-item>


		</uni-grid>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				"typelist": [{
						"id": 1,
						"typename": "新闻",
						"icon": "/images/1.jpg"
					},
					{
						"id": 2,
						"typename": "公告",
						"icon": "/images/2.jpg"
					},
					{
						"id": 3,
						"typename": "同学",
						"icon": "/images/4.jpg"
					},
					{
						"id": 4,
						"typename": "电话",
						"icon": "/images/5.jpg"
					},
					{
						"id": 5,
						"typename": "留言",
						"icon": "/images/3.jpg"
					}
				],
				list: ['../../static/shuijiao.jpg', '../../static/head_icon.png', '../../static/logo.png']
			}
		},
		onLoad() {

		},
		methods: {
			swiperChange(e) {
				console.log("====", e)
			},
			gridChange(e) {
				console.log("====", e)
			}
		}
	}
</script>

<style>
	page {
		height: 100%;
	}
	.grid-item {
			//让内容上下排列,中部居中
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
		}
		</style>